package com.streaming.flink.udsf;

import org.apache.flink.table.functions.ScalarFunction;

import java.sql.Timestamp;

/**
 * @author 将UTC的时间戳转化为本地的时间戳
 * @Description:
 * @date 2020-08-21
 * @time 22:04
 */
public class UTC2LocalFunction extends ScalarFunction {
    private final long HOUR_8 = 8 * 60 * 60L;

    public Timestamp eval(Timestamp s) {
        long timestamp = s.getTime() + HOUR_8;
        return new Timestamp(timestamp);
    }

}
